package org.mine.design.builder.service.impl;

import org.mine.design.builder.controller.param.RequestParam;
import org.mine.design.builder.data.SubsidyCost;
import org.mine.design.builder.service.SubsidyCalculateService;
import org.springframework.stereotype.Service;

@Service
public class SubsidyCalculateServiceImpl implements SubsidyCalculateService {

    @Override
    public int calculate(RequestParam param) {
        SubsidyCost subsidyCost = SubsidyCost.getSubsidyCost();
        return param.getHoliday()
                ? subsidyCost.getHolidaySubsidy() + subsidyCost.getPlatformSubsidy()
                : subsidyCost.getPlatformSubsidy();
    }
}
